/*******************************************************************************
 * Copyright (c) 2011 Jovansonlee B. Cesar.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Jovansonlee B. Cesar - initial API and implementation
 ******************************************************************************/
package com.ivanceras.server.util;

import java.io.File;

import com.ivanceras.shared.util.Configuration;

public class CleanUp {

	public static void doCleanUp(String directoryName){
		File directory = new File(directoryName);

		File[] files = directory.listFiles();
		for (File file : files)
		{
		   if (!file.delete())
		   {
		       System.out.println("Failed to delete "+file);
		   }
		}
	}
	
	public static void main(String[] args){
		doCleanUp(Configuration.daodirectory);
		doCleanUp(Configuration.mapperdirectory);
		doCleanUp(Configuration.bodirectory);
	}
}
